package com.greate.shiro.springbootshirodemo.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.greate.shiro.springbootshirodemo.entity.SystemPermission;
import com.greate.shiro.springbootshirodemo.mapper.SystemPermissionMapper;
import com.greate.shiro.springbootshirodemo.service.SystemPermissionService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zs
 * @since 2020-07-28
 */
@Service
public class SystemPermissionServiceImpl extends ServiceImpl<SystemPermissionMapper, SystemPermission> implements SystemPermissionService {

	@Override
	public List<String> getPermissionNameByPermissionIds(List<Integer> ids) {
		return lambdaQuery()
			.in(SystemPermission::getId, ids)
			.list()
			.stream()
			.map(SystemPermission::getPermissionValue)
			.collect(Collectors.toList());
	}

}
